package com.example.chatweb.controller;

import com.example.chatweb.entity.Message;
import com.example.chatweb.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ChatController {

    private final ChatService chatService;

    @Autowired
    public ChatController(ChatService chatService) {
        this.chatService = chatService;
    }

    @RequestMapping("/chat")
    public String getChat(@RequestBody Message message){
        return chatService.getChat(message);
    }

    @RequestMapping("/knowledge_base_chat")
    public String getKnowledgeBaseChat(@RequestBody String message){
        return chatService.getKnowledgeBaseChat(message);
    }

    @RequestMapping("/new_knowledge_chat")
    public String newKnowledgeChat(@RequestBody Message message){
        return chatService.Kchat(message);
    }
//    @RequestMapping("/pdf_chat")
//    public String get_pdf_chat(@RequestBody Message message);



}
